package com.ruoyi.system.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.ruoyi.system.domain.BsComment;
import com.ruoyi.system.domain.vo.BsCommentVO;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * 评论记录Mapper接口
 *
 * @author ruoyi
 * @date 2023-11-25
 */
public interface BsCommentMapper extends BaseMapper<BsComment> {

    @Select("select main.title strategyTitle, main.img strategyImg, temp.*\n" +
            "from bs_strategy main\n" +
            "left join bs_comment temp on main.id=temp.aim_id\n" +
            "where main.create_by_id = #{userId}\n" +
            "  and main.del_flag = '0' order by temp.create_time desc ")
    List<BsCommentVO> personalCenterCommentList(@Param("userId") Long userId);
}
